<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script type="text/javascript">
    function fun() {
        console.log(this.name)
    }
    var obj = {
        name:"张三",
        age:fun
    };
    var obj2 = {
        name:"李四",
        age:fun
    };
    //以函数形式调用this是window
    //以对象的形式调用this是当前对象
    // fun();
    obj.age();
    obj2.age();
</script>
<body>
    
</body>
</html>